package com.zwz.controller;

import com.zwz.dto.CourtAnnouncementDTO;
import com.zwz.entity.CourtAnnouncement;
import com.zwz.service.CourtAnnouncementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/court-announcements")
public class CourtAnnouncementController {

    @Autowired
    private CourtAnnouncementService service;

    @PostMapping
    public ResponseEntity<?> create(String enterpriseId  ) {
        try {
//            CourtAnnouncementDTO dto = service.createWithMain(enterpriseId );
            CourtAnnouncementDTO   dto=new CourtAnnouncementDTO(null,null);
            return ResponseEntity.status(HttpStatus.CREATED).body(dto);
        } catch (IllegalArgumentException e) {
            return ResponseEntity.badRequest().body(e.getMessage());
        }
    }

//    @GetMapping("/case/{caseNumber}")
//    public ResponseEntity<List<CourtAnnouncement>> getByCase(
//            @PathVariable String caseNumber) {
//        return ResponseEntity.ok(service.getByCase(caseNumber));
//    }
}